package practice3;

public class Main {

	public static void main(String[] args) {
		Student a[] = new Student[3];
		a[0] = new Student(1,"han",99);
		a[1] = new Student(2,"ding",98);
		a[2] = new Student(3,"xue",95);
		for(Student s:a) {
			s.print();
		}
		System.out.println("平均成绩："+Avg(a));
		
	}
	public static double Avg(Student a[]) {
		double sum = 0;
		for(Student s:a) {
			sum+=s.getGrade();
		}
		return sum/a.length;
	}

}
